#! /bin/sh

build_docs() {
   git checkout "$1" &&
   devscripts/build-docs &&
   rsync -ahP --del --exclude=/robots.txt docs/html/ ../SQLObject-docs/"$2"/
}

cd "`dirname \"$0\"`" &&
PROG_DIR="`pwd`" &&

cd .. &&
build_docs 3.9.1 &&
build_docs master devel &&
rm -rf docs/html &&

cd ../SQLObject-docs &&
exec sitemap_gen.py --config="$PROG_DIR"/sqlobject.org-sitemapconfig.xml
